/*
* @Date: 2021/3/30
* @Author: XueChengwu <xuechengwu@erayt.com>
* @Copyright: 2015-2019 Erayt, Inc.
* @Description: If you have some questions, please contact: xuechengwu@erayt.com.
*/
import Page from './Page';

export default class {
  constructor(option) {
    this.name = option.name;
    this.pages = option.pages || [new Page({
      name: 'page1',
    })];
    this.modals = option.modals || [];
    this.widgets = option.widgets || [];
    this.currentPage = 0;
    this.scene = 'page';
  }

  get current() {
    if (this.scene === 'page') {
      return this.pages[this.currentPage];
    } else if (this.scene === 'modal') {
      return this.modals[this.currentPage];
    }
    return this.widgets[this.currentPage];
  }

}
